package cn.tedu.micro.demo.order.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
public class HelloController {
    //属性注入
    @Value("${server.port}")
    private String port;
    @Value("${spring.application.name}")
    private String applicationName;
    @GetMapping(("/order/hello"))
    public String hello(@RequestHeader(name = "X-Request-red",required = false) String red) {
        log.info("当前用户名称:{}",red);
        log.info("当前项目应用名称:{}",applicationName);
        return "hello; I am from "+port;
    }
}
